
import { Login, LoginOut } from '../auth'
import http from './http'

export const login = async( user, password, type, remember ) => {
    let userinfo = await http.fetchPost("/api/login/in", {username : user, password, type})
    if(!userinfo){ return false }
    Login(userinfo, remember)
    return true
}

export const loginOut = async () =>{
    http.fetchPost("/api/login/out")
    LoginOut()
}